Integrand size = 40, antiderivative size = 127 \[ \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx=-\frac {2 a^2 (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-2+m} (c-c \sin (e+f x))^n}{f g (2-m+n) (3-m+n)}-\frac {a (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (3-m+n)} \]
-2*a^2*(g*cos(f*x+e))^(4-2*m)*(a+a*sin(f*x+e))^(-2+m)*(c-c*sin(f*x+e))^n/f /g/(2-m+n)/(3-m+n)-a*(g*cos(f*x+e))^(4-2*m)*(a+a*sin(f*x+e))^(-1+m)*(c-c*s in(f*x+e))^n/f/g/(3-m+n)
Time = 2.47 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.13 \[ \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx=-\frac {e^{n (-2 \log (\cos (e+f x))+\log (a (1+\sin (e+f x)))+\log (c-c \sin (e+f x)))} g^3 \cos ^{2 n}(e+f x) (g \cos (e+f x))^{-2 m} \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^4 (a (1+\sin (e+f x)))^{m-n} (4-m+n+(2-m+n) \sin (e+f x))}{f (2-m+n) (3-m+n)} \]
-((E^(n*(-2*Log[Cos[e + f*x]] + Log[a*(1 + Sin[e + f*x])] + Log[c - c*Sin[ e + f*x]]))*g^3*Cos[e + f*x]^(2*n)*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])^4 *(a*(1 + Sin[e + f*x]))^(m - n)*(4 - m + n + (2 - m + n)*Sin[e + f*x]))/(f *(2 - m + n)*(3 - m + n)*(g*Cos[e + f*x])^(2*m)))
Time = 0.68 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3042, 3325, 3042, 3323}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a \sin (e+f x)+a)^m (c-c \sin (e+f x))^n (g \cos (e+f x))^{3-2 m} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a \sin (e+f x)+a)^m (c-c \sin (e+f x))^n (g \cos (e+f x))^{3-2 m}dx\) |
\(\Big \downarrow \) 3325 |
\(\displaystyle \frac {2 a \int (g \cos (e+f x))^{3-2 m} (\sin (e+f x) a+a)^{m-1} (c-c \sin (e+f x))^ndx}{-m+n+3}-\frac {a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 a \int (g \cos (e+f x))^{3-2 m} (\sin (e+f x) a+a)^{m-1} (c-c \sin (e+f x))^ndx}{-m+n+3}-\frac {a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+3)}\) |
\(\Big \downarrow \) 3323 |
\(\displaystyle -\frac {2 a^2 (a \sin (e+f x)+a)^{m-2} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+2) (-m+n+3)}-\frac {a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+3)}\) |
(-2*a^2*(g*Cos[e + f*x])^(4 - 2*m)*(a + a*Sin[e + f*x])^(-2 + m)*(c - c*Si n[e + f*x])^n)/(f*g*(2 - m + n)*(3 - m + n)) - (a*(g*Cos[e + f*x])^(4 - 2* m)*(a + a*Sin[e + f*x])^(-1 + m)*(c - c*Sin[e + f*x])^n)/(f*g*(3 - m + n))
3.2.76.3.1 Defintions of rubi rules used
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b* (g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[e + f*x]) ^n/(f*g*(m - n - 1))), x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && Eq Q[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && EqQ[2*m + p - 1, 0] && NeQ[m - n - 1, 0]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(- b)*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[e + f* x])^n/(f*g*(m + n + p))), x] + Simp[a*((2*m + p - 1)/(m + n + p)) Int[(g* Cos[e + f*x])^p*(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IGtQ[Simplify[m + p/2 - 1/2], 0] && !LtQ[n, -1] && !(IGtQ[Sim plify[n + p/2 - 1/2], 0] && GtQ[m - n, 0]) && !(ILtQ[Simplify[m + n + p], 0] && GtQ[Simplify[2*m + n + 3*(p/2) + 1], 0])
\[\int \left (g \cos \left (f x +e \right )\right )^{3-2 m} \left (a +a \sin \left (f x +e \right )\right )^{m} \left (c -c \sin \left (f x +e \right )\right )^{n}d x\]
Leaf count of result is larger than twice the leaf count of optimal. 298 vs. \(2 (126) = 252\).
Time = 0.30 (sec) , antiderivative size = 298, normalized size of antiderivative = 2.35 \[ \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx=\frac {{\left ({\left (m - n - 2\right )} \cos \left (f x + e\right )^{2} + {\left (m - n - 4\right )} \cos \left (f x + e\right ) + {\left ({\left (m - n - 2\right )} \cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - 2\right )} \left (g \cos \left (f x + e\right )\right )^{-2 \, m + 3} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} e^{\left (2 \, n \log \left (g \cos \left (f x + e\right )\right ) - n \log \left (a \sin \left (f x + e\right ) + a\right ) + n \log \left (\frac {a c}{g^{2}}\right )\right )}}{2 \, f m^{2} + 2 \, f n^{2} - {\left (f m^{2} + f n^{2} - 5 \, f m - {\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right )^{2} - 10 \, f m - 2 \, {\left (2 \, f m - 5 \, f\right )} n + {\left (f m^{2} + f n^{2} - 5 \, f m - {\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right ) + {\left (2 \, f m^{2} + 2 \, f n^{2} - 10 \, f m - 2 \, {\left (2 \, f m - 5 \, f\right )} n + {\left (f m^{2} + f n^{2} - 5 \, f m - {\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right ) + 12 \, f\right )} \sin \left (f x + e\right ) + 12 \, f} \]
((m - n - 2)*cos(f*x + e)^2 + (m - n - 4)*cos(f*x + e) + ((m - n - 2)*cos( f*x + e) + 2)*sin(f*x + e) - 2)*(g*cos(f*x + e))^(-2*m + 3)*(a*sin(f*x + e ) + a)^m*e^(2*n*log(g*cos(f*x + e)) - n*log(a*sin(f*x + e) + a) + n*log(a* c/g^2))/(2*f*m^2 + 2*f*n^2 - (f*m^2 + f*n^2 - 5*f*m - (2*f*m - 5*f)*n + 6* f)*cos(f*x + e)^2 - 10*f*m - 2*(2*f*m - 5*f)*n + (f*m^2 + f*n^2 - 5*f*m - (2*f*m - 5*f)*n + 6*f)*cos(f*x + e) + (2*f*m^2 + 2*f*n^2 - 10*f*m - 2*(2*f *m - 5*f)*n + (f*m^2 + f*n^2 - 5*f*m - (2*f*m - 5*f)*n + 6*f)*cos(f*x + e) + 12*f)*sin(f*x + e) + 12*f)
Timed out. \[ \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx=\text {Timed out} \]
Leaf count of result is larger than twice the leaf count of optimal. 485 vs. \(2 (126) = 252\).
Time = 0.37 (sec) , antiderivative size = 485, normalized size of antiderivative = 3.82 \[ \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx=\frac {{\left (a^{m} c^{n} g^{3} {\left (m - n - 4\right )} - \frac {2 \, a^{m} c^{n} g^{3} {\left (m - n - 6\right )} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {a^{m} c^{n} g^{3} {\left (m - n + 12\right )} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {4 \, a^{m} c^{n} g^{3} {\left (m - n + 2\right )} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {a^{m} c^{n} g^{3} {\left (m - n + 12\right )} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} - \frac {2 \, a^{m} c^{n} g^{3} {\left (m - n - 6\right )} \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {a^{m} c^{n} g^{3} {\left (m - n - 4\right )} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}}\right )} e^{\left (2 \, n \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right ) - 2 \, m \log \left (-\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right ) + m \log \left (\frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right ) - n \log \left (\frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )\right )}}{{\left ({\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} + \frac {3 \, {\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {3 \, {\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {{\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}}\right )} f} \]
(a^m*c^n*g^3*(m - n - 4) - 2*a^m*c^n*g^3*(m - n - 6)*sin(f*x + e)/(cos(f*x + e) + 1) - a^m*c^n*g^3*(m - n + 12)*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 4*a^m*c^n*g^3*(m - n + 2)*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 - a^m*c^n* g^3*(m - n + 12)*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 - 2*a^m*c^n*g^3*(m - n - 6)*sin(f*x + e)^5/(cos(f*x + e) + 1)^5 + a^m*c^n*g^3*(m - n - 4)*sin(f *x + e)^6/(cos(f*x + e) + 1)^6)*e^(2*n*log(sin(f*x + e)/(cos(f*x + e) + 1) - 1) - 2*m*log(-sin(f*x + e)/(cos(f*x + e) + 1) + 1) + m*log(sin(f*x + e) ^2/(cos(f*x + e) + 1)^2 + 1) - n*log(sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 1))/(((m^2 - m*(2*n + 5) + n^2 + 5*n + 6)*g^(2*m) + 3*(m^2 - m*(2*n + 5) + n^2 + 5*n + 6)*g^(2*m)*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 3*(m^2 - m* (2*n + 5) + n^2 + 5*n + 6)*g^(2*m)*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + ( m^2 - m*(2*n + 5) + n^2 + 5*n + 6)*g^(2*m)*sin(f*x + e)^6/(cos(f*x + e) + 1)^6)*f)
Leaf count of result is larger than twice the leaf count of optimal. 28307 vs. \(2 (126) = 252\).
Time = 9.46 (sec) , antiderivative size = 28307, normalized size of antiderivative = 222.89 \[ \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx=\text {Too large to display} \]
2*(m*e^(m*log(2) - n*log(2) - 2*m*log(4*abs(tan(1/8*pi - 1/4*f*x - 1/4*e)) /(tan(1/8*pi - 1/4*f*x - 1/4*e)^2 + 1)) + 2*n*log(4*abs(tan(1/8*pi - 1/4*f *x - 1/4*e))/(tan(1/8*pi - 1/4*f*x - 1/4*e)^2 + 1)) + m*log(abs(a)) + n*lo g(abs(c)) - 2*m*log(abs(g)) - 3*log(2) + 3*log(4*abs(tan(1/8*pi - 1/4*f*x - 1/4*e))/(tan(1/8*pi - 1/4*f*x - 1/4*e)^2 + 1)) + 3*log(abs(g)))*tan(-3/8 *pi + pi*m*floor(1/2*f*x/pi + 1/2*e/pi - floor(1/2*f*x/pi + 1/2*e/pi + 1/2 ) + 1/4) - pi*n*floor(1/2*f*x/pi + 1/2*e/pi - floor(1/2*f*x/pi + 1/2*e/pi + 1/2) + 1/4) + pi*m*floor(1/2*f*x/pi + 1/2*e/pi + 1/2) - pi*n*floor(1/2*f *x/pi + 1/2*e/pi + 1/2) - pi*m*floor(-1/4*sgn(a) + 1/2) - pi*n*floor(-1/4* sgn(c) + 1) + 1/2*pi*m*sgn(tan(1/2*f*x + 1/2*e)^2 - 1) - 1/2*pi*n*sgn(tan( 1/2*f*x + 1/2*e)^2 - 1) - 1/4*pi*m*sgn(a) - 1/4*pi*n*sgn(c) + 1/2*pi*m*sgn (g) + 1/4*pi*m - 1/4*pi*n - 3/4*f*x - 3/2*pi*floor(1/2*f*x/pi + 1/2*e/pi - floor(1/2*f*x/pi + 1/2*e/pi + 1/2) + 1/4) - 3/2*pi*floor(1/2*f*x/pi + 1/2 *e/pi + 1/2) - 3/4*pi*sgn(tan(1/2*f*x + 1/2*e)^2 - 1) - 3/4*pi*sgn(g) - 3/ 4*e)^2*tan(1/2*f*x + 1/2*e)^6 - n*e^(m*log(2) - n*log(2) - 2*m*log(4*abs(t an(1/8*pi - 1/4*f*x - 1/4*e))/(tan(1/8*pi - 1/4*f*x - 1/4*e)^2 + 1)) + 2*n *log(4*abs(tan(1/8*pi - 1/4*f*x - 1/4*e))/(tan(1/8*pi - 1/4*f*x - 1/4*e)^2 + 1)) + m*log(abs(a)) + n*log(abs(c)) - 2*m*log(abs(g)) - 3*log(2) + 3*lo g(4*abs(tan(1/8*pi - 1/4*f*x - 1/4*e))/(tan(1/8*pi - 1/4*f*x - 1/4*e)^2 + 1)) + 3*log(abs(g)))*tan(-3/8*pi + pi*m*floor(1/2*f*x/pi + 1/2*e/pi - f...
Time = 19.08 (sec) , antiderivative size = 476, normalized size of antiderivative = 3.75 \[ \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx=-\frac {{\left (c-c\,\sin \left (e+f\,x\right )\right )}^n\,\left (\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (n-m+2\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}-\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,\left (\cos \left (3\,e+3\,f\,x\right )+\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (-m\,1{}\mathrm {i}+n\,1{}\mathrm {i}+2{}\mathrm {i}\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}-\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,\left (\cos \left (e+f\,x\right )+\sin \left (e+f\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (-m\,1{}\mathrm {i}+n\,1{}\mathrm {i}+6{}\mathrm {i}\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}+\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,\left (\cos \left (2\,e+2\,f\,x\right )+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (n-m+6\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}\right )}{3\,\cos \left (e+f\,x\right )+\sin \left (e+f\,x\right )\,3{}\mathrm {i}-\cos \left (3\,e+3\,f\,x\right )-\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}+\frac {m^2\,1{}\mathrm {i}-m\,n\,2{}\mathrm {i}-m\,5{}\mathrm {i}+n^2\,1{}\mathrm {i}+n\,5{}\mathrm {i}+6{}\mathrm {i}}{m^2-2\,m\,n-5\,m+n^2+5\,n+6}-\frac {3\,\left (\cos \left (2\,e+2\,f\,x\right )+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )\,\left (m^2\,1{}\mathrm {i}-m\,n\,2{}\mathrm {i}-m\,5{}\mathrm {i}+n^2\,1{}\mathrm {i}+n\,5{}\mathrm {i}+6{}\mathrm {i}\right )}{m^2-2\,m\,n-5\,m+n^2+5\,n+6}} \]
-((c - c*sin(e + f*x))^n*(((g*cos(e + f*x))^(3 - 2*m)*(a + a*sin(e + f*x)) ^m*(n - m + 2))/(f*(5*n - 5*m - 2*m*n + m^2 + n^2 + 6)) - ((g*cos(e + f*x) )^(3 - 2*m)*(cos(3*e + 3*f*x) + sin(3*e + 3*f*x)*1i)*(a + a*sin(e + f*x))^ m*(n*1i - m*1i + 2i))/(f*(5*n - 5*m - 2*m*n + m^2 + n^2 + 6)) - ((g*cos(e + f*x))^(3 - 2*m)*(cos(e + f*x) + sin(e + f*x)*1i)*(a + a*sin(e + f*x))^m* (n*1i - m*1i + 6i))/(f*(5*n - 5*m - 2*m*n + m^2 + n^2 + 6)) + ((g*cos(e + f*x))^(3 - 2*m)*(cos(2*e + 2*f*x) + sin(2*e + 2*f*x)*1i)*(a + a*sin(e + f* x))^m*(n - m + 6))/(f*(5*n - 5*m - 2*m*n + m^2 + n^2 + 6))))/(3*cos(e + f* x) + sin(e + f*x)*3i - cos(3*e + 3*f*x) - sin(3*e + 3*f*x)*1i + (n*5i - m* 5i - m*n*2i + m^2*1i + n^2*1i + 6i)/(5*n - 5*m - 2*m*n + m^2 + n^2 + 6) - (3*(cos(2*e + 2*f*x) + sin(2*e + 2*f*x)*1i)*(n*5i - m*5i - m*n*2i + m^2*1i + n^2*1i + 6i))/(5*n - 5*m - 2*m*n + m^2 + n^2 + 6))